import { defineStore } from 'pinia'
import { ref } from 'vue'
import { ModuleStoreKeys } from '@/store/constant'

/**
 * @ClassName userStore
 * @Description 用户相关信息存储
 * @Author xuyizhuo
 * @Date 2024/12/11 22:00
 */
export default defineStore(ModuleStoreKeys.USER, () => {
    const token = ref('')
    const userInfo = ref<{ uname: string }>({
        uname: 'xuyizhuo',
    })

    const updateUserInfo = () => {
        userInfo.value.uname = 'XyzGIS'
    }

    return { userInfo, token, updateUserInfo }
})
